import request from '../request'
//   获取订单外卖新任务详情
export const takeAwaynNewTask = (data: object, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/takeOutNewTaskItem`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}

//外卖待取货详情
export const takeAwayNext = (data: object, loadingShow: boolean, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/getWaitGoodItem`,
      method: 'POST',
      show: loadingShow,
      data
    },
    Proxy
  )
}

// 外卖配送中详情
export const takeAwayDeliveryin = (data: object, loadingShow: boolean, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/getDeliveryItem/`,
      method: 'POST',
      show: loadingShow,
      data
    },
    Proxy
  )
}
// 跑腿新任务详情
export const runErrandNewTask = (data: any, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/runNewTaskItem`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}

// 跑腿待取货详情
export const runErrandWaitPickItemDelails = (data: any, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/runWaitPickItem`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}
//跑腿配送中详情
export const runErrandDistributionDeltails = (data: any, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/runDistributionItem`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}
// 外卖抢单功能
export const makeOrder = (data: any, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/robOrder`,
      method: 'POST',
      data,
      show: true,
    },
    Proxy
  )
}

//跑腿抢单
export const runErrandsMakeOrder = (data: any, id: number | string, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/grabOrder/${id}`,
      method: 'GET',
      show: true,
      data
    },
    Proxy
  )
}

//外卖我已到店
export const takeGoods = (id: number | string, data: any, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/riderArrivedAndTakedGoods/${id}`,
      method: 'GET',
      show: true,
      data

    },
    Proxy
  )
}


//跑腿我已取货/正在购买
export const runErrandReceviedGoods = (data: object, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/receivedGoods`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}



//   外卖已送达
export const delivered = (data: object, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/delivered`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}
//   跑腿已送达
export const runErrandsdelivered = (data: object, Proxy: any) => {
  return request(
    {
      url: `/rider/errandController/haveReached`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}

// 转单
export const tfOrder = (data: object, Proxy: any) => {
  return request(
    {
      url: `/rider/systemRiderTakeaway/tfOrder`,
      method: 'POST',
      show: true,
      data
    },
    Proxy
  )
}

// 隐私号拨打电话
export function getPhone(data:any, Proxy:any) {
	return request({
		url: '/member/orderPm/getPhone',
		method: 'GET',
		Show: false,
		data
	}, Proxy)
}

